// Tabs and Pills
.tabs,
.pills {
  padding: 0;
  margin: 0 0 20px;
  list-style: none;
  .clearfix();
  > li {
    float: left;
    > a {
      display: block;
    }
  }
}

// Tabs
.tabs {
  border-color: #ddd;
  border-style: solid;
  border-width: 0 0 1px;
  > li {
    position: relative; // For the dropdowns mostly
    margin-bottom: -1px;
    > a {
      padding: 0 15px;
      margin-right: 2px;
      line-height: @baseLineHeight * 2;
      border: 1px solid transparent;
      .border-radius(4px 4px 0 0);
      &:hover {
        text-decoration: none;
        background-color: #eee;
        border-color: #eee #eee #ddd;
      }
    }
  }
  // Active state, and it's :hover to override normal :hover
  .active > a,
  .active > a:hover {
    color: @gray;
    background-color: @white;
    border: 1px solid #ddd;
    border-bottom-color: transparent;
    cursor: default;
  }
}

.tabbable {
  margin-bottom: @baseLineHeight;

  // Tabs on top
  .tabs {
    margin-bottom: 0;
    border-bottom: 0;
  }
  .tab-content {
    padding: 19px;
    border: 1px solid #ddd;
  }

  // Tabs on bottom
  &.tabs-bottom .tabs > li {
    margin-top: -1px;
    margin-bottom: 0;
  }
  &.tabs-bottom .tabs > li > a {
    .border-radius(0 0 4px 4px);
    &:hover {
      border-bottom-color: transparent;
      border-top-color: #ddd;
    }
  }
  &.tabs-bottom .tabs > .active > a,
  &.tabs-bottom .tabs > .active > a:hover {
    border-color: transparent #ddd #ddd #ddd;
  }

  // Tabs on left and right
  &.tabs-left,
  &.tabs-right {
    .clearfix();
    .tabs {
      // Give a fixed width to avoid floating .tab-con
      width: 100px;
      // Unfloat them so they stack
      > li {
        float: none;
        margin-bottom: -1px;
        > a {
          margin-bottom: 2px;
          &:hover {
            border-color: transparent;
          }
        }
      }
    }
  }

  // Tabs on left
  &.tabs-left {
    .tab-content {
      margin-left: 100px;
    }
    .tabs {
      float: left;
      > li {
        margin-right: -1px;
        > a {
          margin-right: 0;
          .border-radius(4px 0 0 4px);

          &:hover {
            border-right-color: #ddd;
          }
        }
      }
      // Active state
      .active > a,
      .active > a:hover {
        border-color: #ddd;
        border-right-color: transparent;
      }
    }
  }

  // Tabs on right
  &.tabs-right {
    .tab-content {
      margin-right: 100px;
    }
    .tabs {
      float: right;
      > li {
        margin-left: -1px;
        > a {
          margin-left: 0;
          .border-radius(0 4px 4px 0);

          &:hover {
            border-left-color: #ddd;
          }
        }
      }
      // Active state
      .active > a,
      .active > a:hover {
        border-color: #ddd;
        border-left-color: transparent;
      }
    }
  }
}


// Dropdowns in tabs
.tabs {
  // first one for backwards compatibility
  .menu-dropdown,
  .dropdown-menu {
    top: 35px;
    border-width: 1px;
    .border-radius(0 6px 6px 6px);
  }
  // first one for backwards compatibility
  a.menu:after,
  .dropdown-toggle:after {
    border-top-color: #999;
    margin-top: 15px;
    margin-left: 5px;
  }
  // first one for backwards compatibility
  li.open.menu .menu,
  .open.dropdown .dropdown-toggle {
    border-color: #999;
  }
  // first one for backwards compatibility
  li.open a.menu:after,
  .dropdown.open .dropdown-toggle:after {
    border-top-color: #555;
  }
}

// Pills
.pills {
  > li > a {
    padding: 0 15px;
    margin: 5px 3px 5px 0;
    line-height: 30px;
    text-shadow: 0 1px 1px @white;
    .border-radius(15px);
    &:hover {
      color: @white;
      text-decoration: none;
      text-shadow: 0 1px 1px rgba(0,0,0,.25);
      background-color: @linkColorHover;
    }
  }
  .active > a {
    color: @white;
    text-shadow: 0 1px 1px rgba(0,0,0,.25);
    background-color: @linkColor;
  }
}

// Stacked pills
.pills-vertical > li {
  float: none;
}

// Tabbable areas
.tab-content > .tab-pane,
.pill-content > .pill-pane {
  display: none;
}
.tab-content > .active,
.pill-content > .active {
  display: block;
}


// Step nav
.step-nav {
  position: relative; // for prev/next links
  margin: 0 0 @baseLineHeight;
  list-style: none;
  line-height: 30px;
  text-align: center;
  background-color: #f5f5f5;
  .border-radius(15px);
  li {
    display: inline;
    color: @grayLight;
  }
  // prev/next links
  .prev,
  .next {
    position: absolute;
    top: 6px;
  }
  .prev {
    left: 15px;
  }
  .next {
    right: 15px;
  }
  // indicators for each step/page/item/etc
  .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 3px;
    text-indent: -999em;
    background-color: @grayLight;
    .border-radius(5px);
    .box-shadow(inset 0 1px 1px rgba(0,0,0,.25));
  }
  .dot:hover,
  .active .dot {
    background-color: @grayDark;
  }
}


// Subnav
// STILL A WIP
.subnav {
  #gradient > .vertical(#f5f5f5, #eeeeee);
  @shadow: inset 0 1px 0 #fff, 0 0 5px rgba(0,0,0,.5);
  .box-shadow(@shadow);
  a {
    padding: 8px 10px;
    font-size: 12px;
    color: @linkColor;
    text-shadow: 0 1px 0 #fff;
    border-left: 1px solid #f9f9f9;
    border-right: 1px solid #e5e5e5;
    &:hover {
      color: @linkColorHover;
      background-color: #eee;
    }
  }
  li:first-child a {
    border-left: 0;
    .border-radius(6px 0 0 6px);
  }
  li:last-child a {
    border-right: 0;
    .border-radius(0 6px 6px 0);
  }
  ul .active > a {
    color: @grayDark;
    background-color: #eee;
  }
}